<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>登录</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="css/login.css">
  <link rel="stylesheet" href="js/layui/css/layui.css">
  <!--<script src="js/layui/layui.js"></script>-->
  <script src="/js/layui/layui.all.js"></script>
  <script src="/admin/js/token.js"></script>
  <!--<script src="js/jquery-2.2.4.js"></script>-->
</head>
<body>

<div class="user-login user-display-show" id="user-login">
  <div class="loginForm layui-bg-black" style="position: relative;left: 50%;transform: translateX(-50%);">
    <div class="user-login-main">
      <div class="user-login-box user-login-header">
        <h3>英飞拓智能投影系统</h3>
        <p>站点登录</p>
      </div>
      <div class="user-login-box user-login-body layui-form">
        <div class="layui-form-item" style="margin-bottom: 15px;">
          <label class="user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
          <input type="text" name="username" id="LAY-user-login-username" lay-verify="required" placeholder="用户名"
                 class="layui-input">
        </div>
        <div class="layui-form-item">
          <label class="user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
          <input type="password" name="password" id="LAY-user-login-password" lay-verify="required" placeholder="密码"
                 class="layui-input">
        </div>
        <div class="layui-form-item">
          <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="LAY-user-login-submit" id="station_login">登 入</button>
        </div>
        <div class="layui-form-item">
          <a href="/"  style="float: right;color: white;">用户登录</a>
        </div>
      </div>
    </div>
  </div>


  <div class="layui-trans user-login-footer">
    <p>© 2019 <a href="#" target="_blank">英飞拓智慧影视管理系统</a></p>
  </div>
</div>
</body>
<script>

  var $=layui.$;

  $("#station_login").click(function () {

      $.ajax({
          url:"/admin/station/query/StationLogin",
          type:"get",
          dataType: "json",
          contentType:"application/json;charset=utf-8",
          data:{
              username:$("#LAY-user-login-username").val(),
              password:$("#LAY-user-login-password").val()
          },
          success:function (res) {
              if(res.code==200){

                layer.msg("登陆成功",{
                      icon:1,
                      time:1000
                  },
                   function () {
                    // alert("登陆成功");
                      location="/admin/station_config/index.html?id="+res.data.stationId+"#/layui/grid", "_blank";
                  });
              }else{
                layer.msg("登陆失败"+res.msg,{
                      icon:2,
                      time:1000
                  });
                // alert("账号或密码错误");
              }
          },
          error:function () {

          }

      })
  })

</script>
</html>
